package com.example.myapplication.realtime

import com.google.gson.annotations.SerializedName

/**
 * 权限相关数据类
 */

data class AuthData(
    val username: String,
    val password: String,
    val timestamp: Long
)

data class AuthSuccessData(
    @SerializedName("user_id") val userId: Long,
    @SerializedName("user_info") val userInfo: UserInfo,
    val permissions: UserPermissions,
    val timestamp: String
)

data class UserInfo(
    val id: Long,
    val username: String,
    @SerializedName("real_name") val realName: String,
    val department: String,
    @SerializedName("user_type") val userType: String
)

data class UserPermissions(
    @SerializedName("can_add_patients") val canAddPatients: Boolean,
    @SerializedName("can_view_all_patients") val canViewAllPatients: Boolean,
    @SerializedName("can_view_department_patients") val canViewDepartmentPatients: Boolean,
    @SerializedName("can_approve_users") val canApproveUsers: Boolean
)

data class AddPatientData(
    val name: String,
    val gender: String,
    val age: Int?,
    val phone: String?,
    @SerializedName("idCard") val idCard: String?,
    @SerializedName("examinationDate") val examinationDate: String,
    val diagnosis: String?,
    val notes: String?,
    @SerializedName("examinationName") val examinationName: String?,
    @SerializedName("admissionDate") val admissionDate: String?,
    val timestamp: Long
)

data class PatientInfo(
    val id: Long,
    val name: String,
    val gender: String,
    val age: Int?,
    val phone: String?,
    @SerializedName("examination_date") val examinationDate: String,
    val diagnosis: String?,
    val notes: String?,
    val reporter: String,
    @SerializedName("examination_name") val examinationName: String?,
    val department: String,
    @SerializedName("reported_by") val reportedBy: Long,
    val status: String,
    @SerializedName("created_at") val createdAt: String
)

data class PatientsListData(
    val patients: List<PatientInfo>,
    val count: Int,
    @SerializedName("user_permissions") val userPermissions: UserPermissionsInfo?,
    val timestamp: String
)

data class UserPermissionsInfo(
    @SerializedName("user_type") val userType: String,
    val department: String,
    @SerializedName("can_view_all") val canViewAll: Boolean
)

data class NewPatientAddedData(
    val id: Long,
    val name: String,
    val gender: String,
    val age: Int?,
    val department: String,
    val reporter: String,
    @SerializedName("reported_by") val reportedBy: Long,
    @SerializedName("examination_date") val examinationDate: String,
    val diagnosis: String?,
    val status: String,
    val timestamp: String
)

data class EmptyData(
    val timestamp: Long
)
